package com.mianshi;

import java.util.HashMap;
import java.util.Map;

public class zoom2 {
    public String intoRoma(int num){
        String[] thous = {"","M","MM","MMM"};
        String[] hand = {"","C","CC","CCC","CD","D","DC","DCC","DCCC","CM"};
        String[] ten = {"","X","XX","XXX","XL","L","LX","LXX","LXXXX","XC"};
        String[] one = {"","I","II","III","IV","V","VI","VII","VIII","IX"};

        StringBuffer sb = new StringBuffer();
        sb.append((thous[num/1000]));
        sb.append(hand[num%100/100]);
        sb.append(ten[num%100/10]);
        sb.append(one[num%10]);
        return sb.toString();
    }
}
